package top.fzqblog.typecheck

/**
 * Created by 抽离 on 2017/8/3 0003.
 */
fun demo(x: Any) {
    if (x is String) {
        print(x.length) // x is automatically cast to String
    }
}

fun main(args: Array<String>) {
    val a ="lalal"

    println("：" + a is String)

//    println("：" + a is Int)//直接报错

    demo(a)


    val y = "lalal"

    val x: String? = y as? String
    
    val z = "lalal"

    println("\nx：" + x)

    println("\ny：" + y)

    println("x==y：" + x.equals(y))

    println("======x===y：" + x===y)

    println("======x===z：" + x!==z)
}